import javax.swing.*;

// 游戏主类
public class TankGame {
    public static final int WIDTH = 640;
    public static final int HEIGHT = 640;
    
    public static void main(String[] args) {
        // 在事件调度线程中创建和操作GUI组件
        SwingUtilities.invokeLater(() -> {
            JFrame frame = new JFrame("坦克大战");
            GamePanel gamePanel = new GamePanel();
            
            frame.add(gamePanel);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setResizable(false);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        });
    }
}
